<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:metadata>
		<f:viewParam name="cookbook_id"
			value="#{userOrderDayFoodList.cookbook.id}"></f:viewParam>
	</f:metadata>
	<ui:define name="content">
		<div class="entry">
			<p:toolbar styleClass="admin-nav-toolbar">
				<p:toolbarGroup>
					<h:outputLabel value="#{commonMsg.currentPositionLabel} 订餐啦"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button outcome="/admin/order/cookbookList" value="不订了，闪人"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>
			<h:form id="form">
				<p:dataTable lazy="true" id="dataTable"
					value="#{userOrderDayFoodList.lazyModel}" var="f" paginator="true"
					paginatorPosition="bottom" rows="15"
					currentPageReportTemplate="#{commonMsg.pageReportTemplate}"
					paginatorTemplate="#{commonMsg.paginatorTemplate}"
					rowsPerPageTemplate="15,50,100"
					emptyMessage="#{commonMsg.noResultMsg}"
					selection="#{userOrderDayFoodList.orderDayFoodList}">
					<f:facet name="header">

						<h:outputText style="color:red;font-size: larger;"
							value="要订哪天的就把前面方框打个挑，全订就挑最上面那个就行，默认都订午饭，如果订早饭，别忘了把早饭开关打开，不订午饭就把午饭开关关了"></h:outputText>


					</f:facet>
					<p:column selectionMode="multiple" style="width:18px"
						exportable="false">

					</p:column>


					<p:column>
						<f:facet name="header">
							<h:outputText value="菜单编号"></h:outputText>
						</f:facet>
						<h:outputText value="#{f.cookbook.id}"></h:outputText>

					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="编号"></h:outputText>
						</f:facet>
						<h:outputText value="#{f.id}"></h:outputText>

					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="日期"></h:outputText>
						</f:facet>
						<h:outputText value="#{f.date}"></h:outputText>

					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="星期几"></h:outputText>
						</f:facet>
						<h:outputText value="#{f.weekday}"></h:outputText>

					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="午餐"></h:outputText>
						</f:facet>
						<p:selectBooleanButton offLabel="没订" onLabel="订了"
							value="#{f.lunch}" />
						&#09;
						<h:outputText value="#{f.food1.name}"></h:outputText>
						&#09;
						<h:outputText rendered="#{f.food2 ne null and f.food2.name ne null and f.food2.name ne ''}" value="+"></h:outputText>
						<h:outputText value="#{f.food2.name}"></h:outputText>

					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="早餐"></h:outputText>
						</f:facet>
						<p:selectBooleanButton offLabel="没订" onLabel="订了"
							value="#{f.breakfast}" />

					</p:column>
					<f:facet name="footer">
						<ui:fragment
							rendered="#{userOrderDayFoodList.checkCookbook(userOrderDayFoodList.cookbook.id)}">
							<p:commandButton id="multiViewButton" value="妥了，就订这些"
								icon="ui-icon-mail-open"
								actionListener="#{userOrderDayFoodList.saveOrder()}"
								onstart="return confirm('确定要提交了么，看看自己要订那天前面方框打挑了么，没打可定不上啊！');">

							</p:commandButton>


							<h:outputText style="color:red;font-size: larger;"
								value="点左边这个超帅的按钮订饭哦～"></h:outputText>
						</ui:fragment>
					</f:facet>
				</p:dataTable>


			</h:form>
		</div>
	</ui:define>
</ui:composition>

